var G={
	appcode:'${appcode!}',
	user:${user!},
	group:${group!},
	menus:${menus!},
	roles:${roles!},
	settings:${settings!}
};
var hasrole=function(role){
	var roles=G.roles;
	for(let index in roles) {  
		if(roles[index].code==role){
		return true;
		}
    };  
    return false;
}
var getmenu=function(menu){
	var menus=G.menus;
	for(let index in menus) {  
		if(menus[index].menu==menu){
		return menus[index];
		}
    };  
    return {};
}
var hasmenu=function(menu){
	var menus=G.menus;
	for(let index in menus) {  
		if(menus[index].menu==menu){
		return true;
		}
    };  
    return false;
}
var getsetting=function(key){
	var settings=G.settings;
	for(let index in settings) {  
		if(G.appcode==settings[index].app&&settings[index].key==key){
		return settings[index].value;
		}
    };  
    return '';
}
